﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Saber.Plugin.NtfsSearch
{
    /// <summary>
    /// Suffixes.xaml 的交互逻辑
    /// </summary>
    public partial class Suffixes
    {
        private PluginInitContext context;
        private Settings _settings;
        public Suffixes(PluginInitContext context, Settings settings)
        {
            InitializeComponent();
            this.context = context;
           
            _settings = settings;
            tbSuffixes.Text = string.Join(Settings.SuffixSeperator.ToString(), _settings.Suffixes);
        }

        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(tbSuffixes.Text))
            {
                MessageBox.Show("文件后缀不能为空");
                return;
            }

            _settings.Suffixes = tbSuffixes.Text.Split(Settings.SuffixSeperator);
            this.Close();
            //MessageBox.Show("成功更新索引文件后缀");
        }
    }
}
